﻿
@inject IRelationUserService rService
@{
    var lstItem = ViewData["UserId"]!=null? rService.GetRelationByUserId(ViewData["UserId"].ToString(), 1):null;
    Layout = null;
}
@model List<GroupEntity>
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title">设置组</h4>
    </div>
    <div class="modal-body">
        <div class="jstree">
            <ul>
                <li data-jstree='{"opened":true,"icon":"fa fa-user"}' id="0">
                    设置组
                    <ul>
                        @{
                            if (Model != null && Model.Count > 0)
                            {
                                foreach (var item in Model)
                                {
                                    bool selected = (lstItem != null && lstItem.Where(x => x.ResourceId == item.GroupId).FirstOrDefault() != null);
                                    <li data-jstree='{"icon":"fa fa-user","selected":@selected.ToString().ToLower(),"id":"@item.GroupId"}' id="@item.GroupId">@item.GroupName</li>
                                }
                            }

                        }

                    </ul>
                </li>
            </ul>
        </div>
    </div>
    <div class="modal-footer">

    </div>
